﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StandardPartCo
{
    public class PartType
    {
        /// <summary>
        /// 名称
        /// </summary>
        public String name { get; set; }

        /// <summary>
        /// ID
        /// </summary>
        public int id { get; set; }
        /// <summary>
        /// 父类型ID
        /// </summary>
        public int parentid { get; set; }
        /// <summary>
        /// 序号
        /// </summary>
        public int orderid { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public String des { get; set; }

        /// <summary>
        /// 图片名称
        /// </summary>
        public String picName { get; set; }

    }

    public class Part
    {
        /// <summary>
        /// ID
        /// </summary>
        public int id { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public String name { get; set; }

        /// <summary>
        /// 所属类型
        /// </summary>
        public int ownertypeid { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public String des { get; set; }
    }

    public enum paramtype
    {
        t_int = 0,
        t_double = 1,
        t_string = 2,
        t_bool = 3,
    };

    public class Param
    {
        /// <summary>
        /// 参数名称
        /// </summary>
        public String name { get; set; }
        /// <summary>
        /// 参数标题
        /// </summary>
        public String title { get; set; }
        /// <summary>
        /// ID
        /// </summary>
        public int id { get; set; }

        /// <summary>
        /// 所属分类
        /// </summary>
        public int ownertypeId { get; set; }

        /// <summary>
        /// 参数类型
        /// </summary>
        public paramtype type { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public String Unit { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        public String des { get; set; }
    }

    public class ParamValue
    {
        /// <summary>
        /// 所属Part
        /// </summary>
        public int partid { get; set; }
        /// <summary>
        /// 值字符串
        /// </summary>
        public String value { get; set; }

        /// <summary>
        /// 参数ID
        /// </summary>
        public int paramid { get; set; }
    }

    public enum ParamGroupType
    {
        leaf,
        group
    };

    public class ParamGroup
    {
        /// <summary>
        /// 分类ID
        /// </summary>
        public int type_id { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public String name { get; set; }
        /// <summary>
        /// ID
        /// </summary>
        public int id { get; set; }
        /// <summary>
        /// 参数分组父节点
        /// </summary>
        /// <returns></returns>
        public int parent { get; set; }
        /// <summary>
        /// 序号
        /// </summary>
        public int index { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        /// 代表一个参数,或代表有子节点的分组.
        public ParamGroupType type { get; set; }

        /// <summary>
        /// 参数 
        /// </summary>
        /// 当type等于leaf时有效
        public int param { get; set; }


    }
}
